#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;


vector<int> twoSum1(vector<int>& price, int target)
{
    int left = 0;
    int right = price.size() - 1;
    sort(price.begin(), price.end());
    while (left < right)
    {
        if (price[left] + price[right] < target)
        {
            left++;
        }
        else if (price[left] + price[right] > target)
        {
            right--;
        }
        else
        {
            break;
        }
    }
    return { price[left],price[right] };
}
vector<int> twoSum2(vector<int>& price, int target)
{
    int tag = 0;
    int i, j = 0;
    for (i = 0; i < price.size(); i++)
    {
        for (j = i; j < price.size(); j++)
        {
            if (price[i] + price[j] == target)
            {
                tag = 1;
                break;
            }
        }
        if (tag == 1)
        {
            break;
        }
    }
    return { price[i],price[j] };
}

int main()
{

}
